package nus.iss.ga.ui;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.TableCellRenderer;

public class ValueRenderer extends JTextField implements TableCellRenderer {
	private static final Color hilite = new Color(0xE8E8E8);
	boolean selected;
	
	public void setSelected(boolean selected){
		this.selected = selected;
	}

	public boolean isSelected(){
		return this.selected;
	}
    public ValueRenderer() {
        this.setOpaque(true);
        //JTextField txt = new JTextField();
        
        
    }

  
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		// TODO Auto-generated method stub
	      Value v = (Value) value;
	        this.setSelected(v.selected);
	        this.setText(v.value);
	        return this;
	}

}
